# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kio-extras
pkgver=23.08.4
pkgrel=0
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://www.kde.org/applications/internet/"
pkgdesc="Additional components to increase the functionality of KIO"
license="GPL-2.0-or-later (LGPL-2.1-only OR LGPL-3.0-only)"
depends="kinit5"
makedepends="
	extra-cmake-modules
	gperf
	kactivities5-dev
	karchive5-dev
	kbookmarks5-dev
	kconfig5-dev
	kconfigwidgets5-dev
	kcoreaddons5-dev
	kdbusaddons5-dev
	kdnssd5-dev
	kdoctools5-dev
	kdsoap-dev
	kguiaddons5-dev
	khtml-dev
	ki18n5-dev
	kiconthemes5-dev
	kio5-dev
	kpty5-dev
	libmtp-dev
	libssh-dev
	nfs-utils-dev
	phonon-dev
	qt5-qtbase-dev
	qt5-qtsvg-dev
	samba-dev
	samurai
	shared-mime-info
	solid5-dev
	syntax-highlighting5-dev
	"
checkdepends="xvfb-run dbus"
_repo_url="https://invent.kde.org/network/kio-extras.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kio-extras-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	dbus-run-session -- xvfb-run ctest --test-dir build --output-on-failure \
		-E "testkioarchive|thumbnailtest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
ac2be6e745121962e13fe952d746281fa45778b6d491b001b9ea7a65caedfd5d6354ee75537fde0bf174638d248eb8796db6710830641149dcf35544048cfe27  kio-extras-23.08.4.tar.xz
"
